package train48days;

import java.util.Scanner;

public class 计算每个月兔子的总数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(getcount(n));
    }
    //递归解法
//    private static int getcount(int n ){
//         if (n ==1|| n ==2){
//             return 1;
//         }
//         return getcount(n-1)+getcount(n-2);
//    }
    //常规
    private static int getcount(int n ){
        int oldcount = 1;
        int youngcount = 1;
        int mouth1=1;
        int mouth2=0;
        for (int i = 4; i <=n ; i++) {
            oldcount=oldcount+mouth2;
            mouth2=mouth1;
            mouth1=oldcount;
            youngcount = mouth1+mouth2;
        }
        return oldcount+youngcount;
    }

}
